package org.example2;

import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class MultiStringClient {
    public static void main(String[] args) throws Exception {

        Socket socket = new Socket("localhost", 7777);

        OutputStream outputStream = socket.getOutputStream();
        Scanner scanner = new Scanner(System.in);

        while (true) {
            System.out.println("请输入要发给服务端的信息:");
            String input = scanner.nextLine();
            System.out.println("input is "+input);
            outputStream.write(input.getBytes());
            socket.shutdownOutput();
        }


    }
}
